package com.mediacloud.app.newsmodule.activity.audio

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.mediacloud.app.assembly.util.loadXWithRadiusGlide
import com.mediacloud.app.newsmodule.R
import com.mediacloud.app.newsmodule.model.AudioDetailAnchorListBean
import com.mediacloud.app.reslib.enums.AppFactoryGlobalConfig

class AudioAnchorListAdapter :
    BaseQuickAdapter<AudioDetailAnchorListBean, BaseViewHolder>(R.layout.item_audio_detail_anchor_list) {
    var radius = 0
    override fun convert(helper: BaseViewHolder, item: AudioDetailAnchorListBean?) {
        val audioAlbumLogo = helper.getView<ImageView>(R.id.iv_audio_detail_anchor_list)
        helper.setText(R.id.tv_audio_detail_anchor_list_name, item?.nickname)
            .setText(R.id.tv_audio_detail_anchor_list_num, "${item?.articleHitCount}")
            .addOnClickListener(R.id.tv_audio_detail_anchor_list_works)
        audioAlbumLogo?.loadXWithRadiusGlide(
            item?.avatar,
            radius,
            AppFactoryGlobalConfig.getDefaultImageLoadDrawable()
        )
    }

}